<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
SortedMaps (Guava: Google Core Libraries for Java - r08)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="SortedMaps (Guava: Google Core Libraries for Java - r08)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/google/common/collect/SortedMapDifference.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/google/common/collect/SortedSetMultimap.html" title="interface in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?com/google/common/collect/SortedMaps.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SortedMaps.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.common.collect</FONT>
<BR>
Class SortedMaps</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.collect.SortedMaps</B>
</PRE>
<HR>
<DL>
<DT><PRE><FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/Beta.html" title="annotation in com.google.common.annotations">@Beta</A>
<A HREF="../../../../com/google/common/annotations/GwtCompatible.html" title="annotation in com.google.common.annotations">@GwtCompatible</A>
</FONT>public final class <B>SortedMaps</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>

<P>
Static utility methods pertaining to <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util"><CODE>SortedMap</CODE></A> instances.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>8</DD>
<DT><B>Author:</B></DT>
  <DD>Louis Wasserman</DD>
</DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;K,V&gt; <A HREF="../../../../com/google/common/collect/SortedMapDifference.html" title="interface in com.google.common.collect">SortedMapDifference</A>&lt;K,V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/SortedMaps.html#difference(java.util.SortedMap, java.util.Map)">difference</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,? extends V&gt;&nbsp;left,
           <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;? extends K,? extends V&gt;&nbsp;right)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the difference between two sorted maps, using the comparator of
 the left map, or <code>Ordering.natural()</code> if the left map uses the
 natural ordering of its elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/SortedMaps.html#filterEntries(java.util.SortedMap, com.google.common.base.Predicate)">filterEntries</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt;&nbsp;unfiltered,
              <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</A>&lt;K,V&gt;&gt;&nbsp;entryPredicate)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a sorted map containing the mappings in <code>unfiltered</code> that
 satisfy a predicate.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/SortedMaps.html#filterKeys(java.util.SortedMap, com.google.common.base.Predicate)">filterKeys</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt;&nbsp;unfiltered,
           <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super K&gt;&nbsp;keyPredicate)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a sorted map containing the mappings in <code>unfiltered</code> whose
 keys satisfy a predicate.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/SortedMaps.html#filterValues(java.util.SortedMap, com.google.common.base.Predicate)">filterValues</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt;&nbsp;unfiltered,
             <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super V&gt;&nbsp;valuePredicate)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a sorted map containing the mappings in <code>unfiltered</code> whose
 values satisfy a predicate.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;K,V1,V2&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V2&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/SortedMaps.html#transformEntries(java.util.SortedMap, com.google.common.collect.Maps.EntryTransformer)">transformEntries</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V1&gt;&nbsp;fromMap,
                 <A HREF="../../../../com/google/common/collect/Maps.EntryTransformer.html" title="interface in com.google.common.collect">Maps.EntryTransformer</A>&lt;? super K,? super V1,V2&gt;&nbsp;transformer)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a view of a sorted map whose values are derived from the original
 sorted map's entries.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;K,V1,V2&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V2&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/SortedMaps.html#transformValues(java.util.SortedMap, com.google.common.base.Function)">transformValues</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V1&gt;&nbsp;fromMap,
                <A HREF="../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super V1,V2&gt;&nbsp;function)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a view of a sorted map where each value is transformed by a
 function.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="transformValues(java.util.SortedMap, com.google.common.base.Function)"><!-- --></A><H3>
transformValues</H3>
<PRE>
public static &lt;K,V1,V2&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V2&gt; <B>transformValues</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V1&gt;&nbsp;fromMap,
                                                        <A HREF="../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super V1,V2&gt;&nbsp;function)</PRE>
<DL>
<DD>Returns a view of a sorted map where each value is transformed by a
 function. All other properties of the map, such as iteration order, are
 left intact. For example, the code: <pre>   <code>SortedMap&lt;String, Integer&gt; map = ImmutableSortedMap.of("a", 4, "b", 9);
   Function&lt;Integer, Double&gt; sqrt =
       new Function&lt;Integer, Double&gt;() {
         public Double apply(Integer in) {
           return Math.sqrt((int) in);
         }
       };
   SortedMap&lt;String, Double&gt; transformed =
        Maps.transformSortedValues(map, sqrt);
   System.out.println(transformed);</code></pre>

 ... prints <code>{a=2.0, b=3.0}</code>.

 <p>Changes in the underlying map are reflected in this view. Conversely,
 this view supports removal operations, and these are reflected in the
 underlying map.

 <p>It's acceptable for the underlying map to contain null keys, and even
 null values provided that the function is capable of accepting null input.
 The transformed map might contain null values, if the function sometimes
 gives a null result.

 <p>The returned map is not thread-safe or serializable, even if the
 underlying map is.

 <p>The function is applied lazily, invoked when needed. This is necessary
 for the returned map to be a view, but it means that the function will be
 applied many times for bulk operations like <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsValue(java.lang.Object)" title="class or interface in java.util"><CODE>Map.containsValue(java.lang.Object)</CODE></A> and
 <code>Map.toString()</code>. For this to perform well, <code>function</code> should
 be fast. To avoid lazy evaluation when the returned map doesn't need to be
 a view, copy the returned map into a new map of your choosing.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="transformEntries(java.util.SortedMap, com.google.common.collect.Maps.EntryTransformer)"><!-- --></A><H3>
transformEntries</H3>
<PRE>
public static &lt;K,V1,V2&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V2&gt; <B>transformEntries</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V1&gt;&nbsp;fromMap,
                                                         <A HREF="../../../../com/google/common/collect/Maps.EntryTransformer.html" title="interface in com.google.common.collect">Maps.EntryTransformer</A>&lt;? super K,? super V1,V2&gt;&nbsp;transformer)</PRE>
<DL>
<DD>Returns a view of a sorted map whose values are derived from the original
 sorted map's entries. In contrast to <A HREF="../../../../com/google/common/collect/SortedMaps.html#transformValues(java.util.SortedMap, com.google.common.base.Function)"><CODE>transformValues(java.util.SortedMap<K, V1>, com.google.common.base.Function<? super V1, V2>)</CODE></A>, this
 method's entry-transformation logic may depend on the key as well as the
 value.

 <p>All other properties of the transformed map, such as iteration order,
 are left intact. For example, the code: <pre>   <code>Map&lt;String, Boolean&gt; options =
       ImmutableSortedMap.of("verbose", true, "sort", false);
   EntryTransformer&lt;String, Boolean, String&gt; flagPrefixer =
       new EntryTransformer&lt;String, Boolean, String&gt;() {
         public String transformEntry(String key, Boolean value) {
           return value ? key : "yes" + key;
         }
       };
   SortedMap&lt;String, String&gt; transformed =
       LabsMaps.transformSortedEntries(options, flagPrefixer);
   System.out.println(transformed);</code></pre>

 ... prints <code>{sort=yessort, verbose=verbose}</code>.

 <p>Changes in the underlying map are reflected in this view. Conversely,
 this view supports removal operations, and these are reflected in the
 underlying map.

 <p>It's acceptable for the underlying map to contain null keys and null
 values provided that the transformer is capable of accepting null inputs.
 The transformed map might contain null values if the transformer sometimes
 gives a null result.

 <p>The returned map is not thread-safe or serializable, even if the
 underlying map is.

 <p>The transformer is applied lazily, invoked when needed. This is
 necessary for the returned map to be a view, but it means that the
 transformer will be applied many times for bulk operations like <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsValue(java.lang.Object)" title="class or interface in java.util"><CODE>Map.containsValue(java.lang.Object)</CODE></A> and <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang"><CODE>Object.toString()</CODE></A>. For this to perform well,
 <code>transformer</code> should be fast. To avoid lazy evaluation when the
 returned map doesn't need to be a view, copy the returned map into a new
 map of your choosing.

 <p><b>Warning:</b> This method assumes that for any instance <code>k</code> of
 <code>EntryTransformer</code> key type <code>K</code>, <code>k.equals(k2)</code> implies
 that <code>k2</code> is also of type <code>K</code>. Using an <code>EntryTransformer</code> key type for which this may not hold, such as <code>ArrayList</code>, may risk a <code>ClassCastException</code> when calling methods on
 the transformed map.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="difference(java.util.SortedMap, java.util.Map)"><!-- --></A><H3>
difference</H3>
<PRE>
public static &lt;K,V&gt; <A HREF="../../../../com/google/common/collect/SortedMapDifference.html" title="interface in com.google.common.collect">SortedMapDifference</A>&lt;K,V&gt; <B>difference</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,? extends V&gt;&nbsp;left,
                                                        <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;? extends K,? extends V&gt;&nbsp;right)</PRE>
<DL>
<DD>Computes the difference between two sorted maps, using the comparator of
 the left map, or <code>Ordering.natural()</code> if the left map uses the
 natural ordering of its elements. This difference is an immutable snapshot
 of the state of the maps at the time this method is called. It will never
 change, even if the maps change at a later time.

 <p>Since this method uses <code>TreeMap</code> instances internally, the keys of
 the right map must all compare as distinct according to the comparator
 of the left map.

 <p><b>Note:</b>If you only need to know whether two sorted maps have the
 same mappings, call <code>left.equals(right)</code> instead of this method.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>left</CODE> - the map to treat as the "left" map for purposes of comparison<DD><CODE>right</CODE> - the map to treat as the "right" map for purposes of comparison
<DT><B>Returns:</B><DD>the difference between the two maps</DL>
</DD>
</DL>
<HR>

<A NAME="filterKeys(java.util.SortedMap, com.google.common.base.Predicate)"><!-- --></A><H3>
filterKeys</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="untested")
</FONT>public static &lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt; <B>filterKeys</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt;&nbsp;unfiltered,
                                                                   <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super K&gt;&nbsp;keyPredicate)</PRE>
<DL>
<DD>Returns a sorted map containing the mappings in <code>unfiltered</code> whose
 keys satisfy a predicate. The returned map is a live view of <code>unfiltered</code>; changes to one affect the other.

 <p>The resulting map's <code>keySet()</code>, <code>entrySet()</code>, and <code>values()</code> views have iterators that don't support <code>remove()</code>, but all
 other methods are supported by the map and its views. When given a key that
 doesn't satisfy the predicate, the map's <code>put()</code> and <code>putAll()</code>
 methods throw an <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang"><CODE>IllegalArgumentException</CODE></A>.

 <p>When methods such as <code>removeAll()</code> and <code>clear()</code> are called
 on the filtered map or its views, only mappings whose keys satisfy the
 filter will be removed from the underlying map.

 <p>The returned map isn't threadsafe or serializable, even if <code>unfiltered</code> is.

 <p>Many of the filtered map's methods, such as <code>size()</code>,
 iterate across every key/value mapping in the underlying map and determine
 which satisfy the filter. When a live view is <i>not</i> needed, it may be
 faster to copy the filtered map and use the copy.

 <p><b>Warning:</b> <code>keyPredicate</code> must be <i>consistent with
 equals</i>, as documented at <A HREF="../../../../com/google/common/base/Predicate.html#apply(T)"><CODE>Predicate.apply(T)</CODE></A>. Do not provide a
 predicate such as <code>Predicates.instanceOf(ArrayList.class)</code>, which is
 inconsistent with equals.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="filterValues(java.util.SortedMap, com.google.common.base.Predicate)"><!-- --></A><H3>
filterValues</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="untested")
</FONT>public static &lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt; <B>filterValues</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt;&nbsp;unfiltered,
                                                                     <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super V&gt;&nbsp;valuePredicate)</PRE>
<DL>
<DD>Returns a sorted map containing the mappings in <code>unfiltered</code> whose
 values satisfy a predicate. The returned map is a live view of <code>unfiltered</code>; changes to one affect the other.

 <p>The resulting map's <code>keySet()</code>, <code>entrySet()</code>, and <code>values()</code> views have iterators that don't support <code>remove()</code>, but all
 other methods are supported by the map and its views. When given a value
 that doesn't satisfy the predicate, the map's <code>put()</code>, <code>putAll()</code>, and <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true#setValue(V)" title="class or interface in java.util"><CODE>Map.Entry.setValue(V)</CODE></A> methods throw an <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang"><CODE>IllegalArgumentException</CODE></A>.

 <p>When methods such as <code>removeAll()</code> and <code>clear()</code> are called
 on the filtered map or its views, only mappings whose values satisfy the
 filter will be removed from the underlying map.

 <p>The returned map isn't threadsafe or serializable, even if <code>unfiltered</code> is.

 <p>Many of the filtered map's methods, such as <code>size()</code>,
 iterate across every key/value mapping in the underlying map and determine
 which satisfy the filter. When a live view is <i>not</i> needed, it may be
 faster to copy the filtered map and use the copy.

 <p><b>Warning:</b> <code>valuePredicate</code> must be <i>consistent with
 equals</i>, as documented at <A HREF="../../../../com/google/common/base/Predicate.html#apply(T)"><CODE>Predicate.apply(T)</CODE></A>. Do not provide a
 predicate such as <code>Predicates.instanceOf(ArrayList.class)</code>, which is
 inconsistent with equals.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="filterEntries(java.util.SortedMap, com.google.common.base.Predicate)"><!-- --></A><H3>
filterEntries</H3>
<PRE>
<FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/GwtIncompatible.html" title="annotation in com.google.common.annotations">@GwtIncompatible</A>(<A HREF="../../../../com/google/common/annotations/GwtIncompatible.html#value()">value</A>="untested")
</FONT>public static &lt;K,V&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt; <B>filterEntries</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A>&lt;K,V&gt;&nbsp;unfiltered,
                                                                      <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</A>&lt;K,V&gt;&gt;&nbsp;entryPredicate)</PRE>
<DL>
<DD>Returns a sorted map containing the mappings in <code>unfiltered</code> that
 satisfy a predicate. The returned map is a live view of <code>unfiltered</code>;
 changes to one affect the other.

 <p>The resulting map's <code>keySet()</code>, <code>entrySet()</code>, and <code>values()</code> views have iterators that don't support <code>remove()</code>, but all
 other methods are supported by the map and its views. When given a
 key/value pair that doesn't satisfy the predicate, the map's <code>put()</code>
 and <code>putAll()</code> methods throw an <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang"><CODE>IllegalArgumentException</CODE></A>.
 Similarly, the map's entries have a <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true#setValue(V)" title="class or interface in java.util"><CODE>Map.Entry.setValue(V)</CODE></A> method that
 throws an <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang"><CODE>IllegalArgumentException</CODE></A> when the existing key and the
 provided value don't satisfy the predicate.

 <p>When methods such as <code>removeAll()</code> and <code>clear()</code> are called
 on the filtered map or its views, only mappings that satisfy the filter
 will be removed from the underlying map.

 <p>The returned map isn't threadsafe or serializable, even if <code>unfiltered</code> is.

 <p>Many of the filtered map's methods, such as <code>size()</code>,
 iterate across every key/value mapping in the underlying map and determine
 which satisfy the filter. When a live view is <i>not</i> needed, it may be
 faster to copy the filtered map and use the copy.

 <p><b>Warning:</b> <code>entryPredicate</code> must be <i>consistent with
 equals</i>, as documented at <A HREF="../../../../com/google/common/base/Predicate.html#apply(T)"><CODE>Predicate.apply(T)</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/google/common/collect/SortedMapDifference.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/google/common/collect/SortedSetMultimap.html" title="interface in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?com/google/common/collect/SortedMaps.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SortedMaps.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>
